package com.liyongjian.xhban.dal;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import com.liyongjian.xhban.model.UserMsg;

public interface UserMsgRepository extends PagingAndSortingRepository<UserMsg, Long> {


    @Query("select t from UserMsg t, User u where t.userId=u.id and t.lookUserId=:userId and t.state!=0 and u.state=1")
    Page<UserMsg> findFriendByLookUserId(@Param("userId") Long userId, Pageable pageable);

}
